#ifndef SYSCONFIG_H
#define SYSCONFIG_H

#include <QJsonObject>
#include <QString>

class SysConfig{
public:
    int configId;
    QString configKey;
    QString configName;
    QString configType;
    QString configValue;
    QString createBy;
    QString createTime;
    QString remark;
    QString updateBy;
    QString updateTime;
    QJsonObject toJsonObject(){
        QJsonObject json;
        json["configId"] = configId;
        json["configKey"] = configKey;
        json["configName"] = configName;
        json["configType"] = configType;
        json["configValue"] = configValue;
        json["createBy"] = createBy;
        json["createTime"] = createTime;
        json["remark"] = remark;
        json["updateBy"] = updateBy;
        json["updateTime"] = updateTime;
        return json;
    }

    static SysConfig* toSysConfig(const QJsonObject& json){
        SysConfig *config = new SysConfig;
        config->configId = json["configId"].toInt();
        config->configKey = json["configKey"].toString();
        config->configName = json["configName"].toString();
        config->configType = json["configType"].toString();
        config->configValue = json["configValue"].toString();
        config->createBy = json["createBy"].toString();
        config->createTime = json["createTime"].toString();
        config->remark = json["remark"].toString();
        config->updateBy = json["updateBy"].toString();
        config->updateTime = json["updateTime"].toString();
        return config;
    }
};

#endif // SYSCONFIG_H
